import axios from '@/plugins/axios';
const BASE_API = import.meta.env.VITE_APP_BASE_APIURL as string;

import { CommontTypes, ResponseVo, WxUserTypes } from '@/type';

export namespace WxUserService {
  export const pageWxUser = async (data:WxUserTypes.PageWxUserType & CommontTypes.IPaginationParam): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.get('/wxuser/page',{params:data, baseURL: BASE_API});
    return res;
  };

  export const addWxUser = async (data:any): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.post('/wxuser/add',data,{baseURL: BASE_API});
    return res;
  };

  export const detailWxUser = async (id:string| number): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.get('/wxuser/detail',{params:{id},baseURL: BASE_API});
    return res;
  };

  export const updateWxUser = async (data:any): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.post('/wxuser/update',data,{baseURL: BASE_API});
    return res;
  };

  export const deleteWxUser = async (id:string|number): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.get('/wxuser/delete',{params:{id},baseURL: BASE_API});
    return res;
  };

}
